package com.lanou.hotel.service.impl;

import com.lanou.hotel.entity.Image;
import com.lanou.hotel.mapper.ImageMapper;
import com.lanou.hotel.service.IImageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author msy
 * @since 2023-10-28
 */
@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image> implements IImageService {

    @Autowired
    private ImageMapper imageMapper;

    @Override
    public List<Image> getImagesByHomeId(String homeId) {
        return imageMapper.selectImagesByHomeId(homeId);
    }

    @Override
    public int removeByHomeId(String homeId) {
        return imageMapper.deleteByHomeId(homeId);
    }
}
